package com.enjoy.queue;

import java.util.Collection;
import java.util.Iterator;
import java.util.Queue;

public class ArrayQueue<E> implements Queue<E> {
    private int[] data;// 数组
    private int head = 0;// 头
    private int tail = 0;// 尾
    private int n = 0;// 元素的大小

    public ArrayQueue(int cap) {
        this.data = new int[cap];
        this.n = cap;
    }

    public void push(int m) {
        // 判断这个队列是不是满了
        if (tail == n) {
            return;
        }
        data[tail] = m;
        tail++;
    }

    public int pop() {
        if (isEmpty()) {
            return -1;
        }
        return data[head++];
    }

    @Override
    public int size() {
        return 0;
    }

    public boolean isEmpty() {
        return head == tail;
    }

    @Override
    public boolean contains(Object o) {
        return false;
    }

    @Override
    public Iterator<E> iterator() {
        return null;
    }

    @Override
    public Object[] toArray() {
        return new Object[0];
    }

    @Override
    public <T> T[] toArray(T[] a) {
        return null;
    }


    @Override
    public boolean remove(Object o) {
        return false;
    }

    @Override
    public boolean addAll(Collection c) {
        return false;
    }

    @Override
    public void clear() {

    }

    @Override
    public boolean retainAll(Collection c) {
        return false;
    }

    @Override
    public boolean removeAll(Collection c) {
        return false;
    }

    @Override
    public boolean containsAll(Collection c) {
        return false;
    }


    @Override
    public boolean add(Object o) {
        return false;
    }

    @Override
    public E remove() {
        return null;
    }

    @Override
    public boolean offer(Object o) {
        return false;
    }

    @Override
    public E poll() {
        return null;
    }

    @Override
    public E element() {
        return null;
    }

    @Override
    public E peek() {
        return null;
    }
}
